from pydantic import BaseModel, Field
from typing import Optional
from fastapi import Query


class DictItemQuery(BaseModel):
    page: int = Field(1, ge=1, description="页码", alias="current")
    size: int = Field(10, ge=1, le=100, description="每页数量")
    dict_type: Optional[str] = Field(None, description="字典类型编码筛选")
    dict_key: Optional[str] = Field(None, description="字典键筛选")
    dict_value: Optional[str] = Field(None, description="字典值筛选")
    category: Optional[str] = Field(None, description="分类筛选")
    keyword: Optional[str] = Field(None, description="关键词搜索（键/值/分类/选项）")

